package aip.core.model.message;

import java.io.Serializable;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name = "AIP_MSG_")
public class Message implements Serializable
{
    private static final long serialVersionUID = -8413649676837726363L;
    public static final String STATE_ASIGNED = "ASSIGNED";
    public static final String STATE_REPLIED = "REPLIED";

    public static Map<String, String> stateMap = new LinkedHashMap<String, String>();
    static
    {
        stateMap.put(STATE_ASIGNED, "未回复");
        stateMap.put(STATE_REPLIED, "已回复");
    }
    /** ID */
    private int id;
    /** 咨询单状态 */
    private String state;
    /** 标题 */
    private String title;
    /** 提交人 */
    private String submiter;
    /** 提价人IP(匿名) */
    private String ip;
    /** 提交时间 */
    private Date submitTime;
    /** 问题 */
    private String question;
    /** 回答人 */
    private String expert;
    /** 回答时间 */
    private Date replyTime;
    /** 回答 */
    private String reply;
    /** 地址 */
    private String address;
    /** 联系电话 */
    private String telephone;
    /** 邮箱 */
    private String mail;
    /** 备注 */
    private String comment;

    /**
     * @return the id
     */
    @Id
    @Column(name = "ID_")
    public int getId()
    {
        return id;
    }

    /**
     * @param id
     *        the id to set
     */
    public void setId(int id)
    {
        this.id = id;
    }

    /**
     * @return the state
     */
    @Column(name = "STATE_")
    public String getState()
    {
        return state;
    }

    /**
     * @param state
     *        the state to set
     */
    public void setState(String state)
    {
        this.state = state;
    }

    /**
     * @return the title
     */
    @Column(name = "TITLE_")
    public String getTitle()
    {
        return title;
    }

    /**
     * @param title
     *        the title to set
     */
    public void setTitle(String title)
    {
        this.title = title;
    }

    /**
     * @return the submiter
     */
    @Column(name = "SUBMITER_")
    public String getSubmiter()
    {
        return submiter;
    }

    /**
     * @param submiter
     *        the submiter to set
     */
    public void setSubmiter(String submiter)
    {
        this.submiter = submiter;
    }

    /**
     * @return the ip
     */
    @Column(name = "IP_")
    public String getIp()
    {
        return ip;
    }

    /**
     * @param ip
     *        the ip to set
     */
    public void setIp(String ip)
    {
        this.ip = ip;
    }

    /**
     * @return the submitTime
     */
    @Column(name = "SUBMIT_TIME_")
    public Date getSubmitTime()
    {
        return submitTime;
    }

    /**
     * @param submitTime
     *        the submitTime to set
     */
    public void setSubmitTime(Date submitTime)
    {
        this.submitTime = submitTime;
    }

    /**
     * @return the question
     */
    @Column(name = "QUSN_")
    public String getQuestion()
    {
        return question;
    }

    /**
     * @param question
     *        the question to set
     */
    public void setQuestion(String question)
    {
        this.question = question;
    }

    /**
     * @return the expert
     */
    @Column(name = "EXPERT_")
    public String getExpert()
    {
        return expert;
    }

    /**
     * @param expert
     *        the expert to set
     */
    public void setExpert(String expert)
    {
        this.expert = expert;
    }

    /**
     * @return the replyTime
     */
    @Column(name = "RE_TIME_")
    public Date getReplyTime()
    {
        return replyTime;
    }

    /**
     * @param replyTime
     *        the replyTime to set
     */
    public void setReplyTime(Date replyTime)
    {
        this.replyTime = replyTime;
    }

    /**
     * @return the reply
     */
    @Column(name = "REPLY_")
    public String getReply()
    {
        return reply;
    }

    /**
     * @param reply
     *        the reply to set
     */
    public void setReply(String reply)
    {
        this.reply = reply;
    }

    /**
     * @return the address
     */
    public String getAddress()
    {
        return address;
    }

    /**
     * @param address the address to set
     */
    public void setAddress(String address)
    {
        this.address = address;
    }

    /**
     * @return the telephone
     */
    public String getTelephone()
    {
        return telephone;
    }

    /**
     * @param telephone the telephone to set
     */
    public void setTelephone(String telephone)
    {
        this.telephone = telephone;
    }

    /**
     * @return the mail
     */
    public String getMail()
    {
        return mail;
    }

    /**
     * @param mail the mail to set
     */
    public void setMail(String mail)
    {
        this.mail = mail;
    }

    /**
     * @return the comment
     */
    @Column(name = "COMMENT_")
    public String getComment()
    {
        return comment;
    }

    /**
     * @param comment
     *        the comment to set
     */
    public void setComment(String comment)
    {
        this.comment = comment;
    }
}
